package com.vercon.moensmart.mode.response;

import android.annotation.SuppressLint;

import com.vercon.moensmart.mode.HealthMeasureTarget;

import java.io.Serializable;
import java.util.ArrayList;

public class MeasureTrendChart implements Serializable {

    public ArrayList<ListDTO> list;
    public String ave_value;

    public static class ListDTO {
        public String name;
        public String value;
    }

    public static class aveValueBean{
        public int measuring_status;
        public float bmi;
        public float fat_rate;
        public float visceral_fat;
        public float muscle_mass;
        public float metabolic_rate;
        public float water_capacity;
        public float bone_mass;
        public float protein;
        public float fat_body_mass;
        public float physical_age;
        public float weight;
        public float body_type;
        public String user_id;
        public String device_topic;
        public String device_id;
        public String product_id;
        public int gender;
        public int bmi_status;
        public int fat_rate_status;
        public int visceral_fat_status;
        public int muscle_mass_status;
        public int metabolic_rate_status;
        public int water_capacity_status;
        public int bone_mass_status;
        public int protein_status;
        public int body_type_status;

        @SuppressLint("DefaultLocale")
        public String getValue(String type){
            switch (type){
                case HealthMeasureTarget.WEIGHT:
                    return "体重:"+String.format("%.1f",weight);
                case HealthMeasureTarget.BMI:
                    return "BMI:"+String.format("%.1f",bmi);
                case HealthMeasureTarget.fat_rate:
                    return "脂肪率:"+String.format("%.1f",fat_rate);
                case HealthMeasureTarget.protein:
                    return "蛋白质:"+String.format("%.1f",protein);
                case HealthMeasureTarget.water_capacity :
                    return "含水率:"+String.format("%.1f",water_capacity);
                case HealthMeasureTarget.visceral_fat:
                    return "内脏脂肪率:"+String.format("%.1f",visceral_fat);
                case HealthMeasureTarget.muscle_mass:
                    return "肌肉量:"+String.format("%.1f",muscle_mass);
                case HealthMeasureTarget.bone_mass:
                    return "含骨量:"+String.format("%.1f",bone_mass);
                case HealthMeasureTarget.metabolic_rate :
                    return "新陈代谢速率:"+String.format("%.1f",metabolic_rate);
                case HealthMeasureTarget.body_type :
                    return "身体类型:"+ HealthMeasureTarget.getBodyType((int)body_type);
                case HealthMeasureTarget.physical_age :
                    return "身体年龄:"+String.format("%.0f",physical_age);
                default:
                    return "";
            }
        }
    }

    public static class valueBean{
        public float bmi;
        public float  fat_rate;
        public float visceral_fat;
        public float muscle_mass;
        public float metabolic_rate;
        public float water_capacity;
        public float bone_mass;
        public float protein;
        public float fat_body_mass;
        public float physical_age;
        public float weight;
        public float  body_type;

        @SuppressLint("DefaultLocale")
        public float getValue(String type){
            switch (type){
                case HealthMeasureTarget.WEIGHT:
                    return weight;
                case HealthMeasureTarget.BMI:
                    return bmi;
                case HealthMeasureTarget.fat_rate:
                    return fat_rate;
                case HealthMeasureTarget.protein:
                    return protein;
                case HealthMeasureTarget.water_capacity :
                    return water_capacity;
                case HealthMeasureTarget.visceral_fat:
                    return visceral_fat;
                case HealthMeasureTarget.muscle_mass:
                    return muscle_mass;
                case HealthMeasureTarget.bone_mass:
                    return bone_mass;
                case HealthMeasureTarget.metabolic_rate :
                    return metabolic_rate;
                case HealthMeasureTarget.body_type :
                    return body_type;
                case HealthMeasureTarget.physical_age :
                    return physical_age;
                default:
                    return 0;
            }
        }


    }


    public static String xLabel(String type,int i){
        if("week".equals(type)){
            switch (i){
                case 0:
                    return "周一";
                case 1:
                    return "周二";
                case 2:
                    return "周三";
                case 3:
                    return "周四";
                case 4:
                    return "周五";
                case 5:
                    return "周六";
                case 6:
                    return "周日";
            }
        }else if("month".equals(type)){
            switch (i){
                case 0:
                    return "第一周";
                case 1:
                    return "第二周";
                case 2:
                    return "第三周";
                case 3:
                    return "第四周";
                case 4:
                    return "第五周";
                case 5:
                    return "第六周";
            }
        }else if("year".equals(type)){
            switch (i){
                case 0:
                    return "1月";
                case 1:
                    return "2月";
                case 2:
                    return "3月";
                case 3:
                    return "4月";
                case 4:
                    return "5月";
                case 5:
                    return "6月";
                case 6:
                    return "7月";
                case 7:
                    return "8月";
                case 8:
                    return "9月";
                case 9:
                    return "10月";
                case 10:
                    return "11月";
                case 11:
                    return "12月";
            }
        }
        return "";
    }
}
